
package std.ref


@!APILevel[
    since: "22"
]
sealed abstract class WeakRefBase {
}

@!APILevel[
    since: "22"
]
public enum CleanupPolicy <: Equatable<CleanupPolicy> {
    @!APILevel[
        since: "22"
    ]
    EAGER |
    @!APILevel[
        since: "22"
    ]
    DEFERRED
    @!APILevel[
        since: "22"
    ]
    public operator func ==(that: CleanupPolicy): Bool
    
    @!APILevel[
        since: "22"
    ]
    public operator func !=(that: CleanupPolicy): Bool
}

@!APILevel[
    since: "22"
]
public class WeakRef<T> <: WeakRefBase where T <: Object {
    @!APILevel[
        since: "22"
    ]
    public init(value: T, cleanupPolicy: CleanupPolicy)
    
    @!APILevel[
        since: "22"
    ]
    public prop cleanupPolicy: CleanupPolicy
    
    /**
    * @throws NoneValueException
    */
    @!APILevel[
        since: "22",
        throwexception: true
    ]
    public prop value: Option<T>
    
    @!APILevel[
        since: "22"
    ]
    public func clear(): Unit
}

